<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
                      "http://www.w3.org/TR/html4/strict.dtd"> 
<html> 
  <head> 
    <title>Contact Example</title> 
 
    <script type="text/javascript" charset="utf-8" src="phonegap.js"></script> 
    <script type="text/javascript" charset="utf-8"> 
 
    // Wait for PhoneGap to load 
    // 
    function onLoad() { 
        document.addEventListener("deviceready", onDeviceReady, false); 
    } 
 
    // PhoneGap is ready 
    // 
    function onDeviceReady() { 
        var paths = navigator.fileMgr.getRootPaths(); 
        var reader = new FileReader(); 
        reader.onload = win; 
        reader.onerror= fail; 
        reader.readAsText(paths[0] + "readme.txt"); 
    } 
 
    function win(evt) { 
        console.log(evt.target.result); 
    } 
 
    function fail(evt) { 
        console.log(evt.target.error.code); 
    } 
 
    </script> 
  </head> 
  <body onload="onLoad()"> 
    <h1>Example</h1> 
    <p>Read File</p> 
  </body> 
</html> 
